﻿@model sipfe.model.dataAccess.SIPMaePersona
@using Resources;
@using sipfe.util;
@{    
    string show = ViewBag.nIdePersona;
}
<script type="text/javascript" src="@Url.Content(@properties.nuevoJS)" ></script>
<script type="text/javascript" src="@Url.Content(@properties.mantePersonaJS)" ></script>
<script type="text/javascript">
    $(function () {       
        calendarioFechaNac('dtFecNacim');
        calendarioFechaNac('dFecFalle');        
    });    
</script>
@if (string.IsNullOrEmpty(show))
{    
    using (Html.BeginForm("regDatosPersonaInp", "MantePerson", FormMethod.Post)){
 @Html.ValidationSummary(false, "Los Siguientes Campos son Obligatorios:")
<input type="hidden" name="swReg" value="@ViewBag.swReg" id="swReg" />
<fieldset style="width: 760px;">
    <legend><span>Registrar Nueva Persona Natural</span></legend>
    <table>
            <tr>                
                <td>
                    <table border="0">
                        <tr>
                            <td>País Emisor<span class="asterisco">(*)</span></td>
                            <td>Tipo documento<span class="asterisco">(*)</span></td>
                            <td>Número documento<span class="asterisco">(*)</span></td>                            
                            <td>Fecha Nacimiento<span class="asterisco">(*)</span></td>
                            <td>Género<span class="asterisco">(*)</span></td>
                        </tr>
                        <tr>
                            <td>@Html.DropDownListFor(model => model.nIdeCodPaisDoc, (IEnumerable<SelectListItem>)ViewBag.PaisEmisor, "--Seleccione--", new { @class = "select8", style = "width:127px;" })</td>
                            <td>@Html.DropDownListFor(model => model.nIdeTipoDocum, (IEnumerable<SelectListItem>)ViewBag.TipoDocIdent, "--Seleccione--", new { @class = "select8", style = "width:127px;"})</td>
                            <td>@Html.TextBoxFor(model => model.vNumDocum, new { @class = "textBoxMay", style = "width:120px;text-transform:none;", maxlength = 20, onkeypress = "return validaAlfaNumTamanio(this,event,20);", onpaste = "return false;", onblur = "javascript:onBlurUpper(this); javascript:validaDocumentoPersona(this,'1','1');" })</td>
                            <td>@Html.TextBoxFor(model => model.dtFecNacim, new { maxlength = 10, readOnly = true })</td>
                            <td>@Html.DropDownListFor(model => model.nIdeTipoGenero, (IEnumerable<SelectListItem>)ViewBag.Genero, "--Seleccione--", new { @class = "select8", style = "width:127px;" })</td>                            
                        </tr>
                        <tr>
                            <td>Primer nombre<span class="asterisco">(*)</span></td>
                            <td>Segundo nombre</td>
                            <td>Apellido paterno<span class="asterisco">(*)</span></td>
                            <td>Apellido materno<span class="asterisco">(*)</span></td>
                            <td>Estado civil<span class="asterisco">(*)</span></td>
                        </tr>
                        <tr>
                            <td>@Html.TextBoxFor(model => model.vPriNombre, new { style = "width:124px;", maxlength = 120, onblur = "javascript:onBlurUpper(this);" })</td>
                            <td>@Html.TextBoxFor(model => model.vSegNombre, new { style = "width:124px;", maxlength = 120, onblur = "javascript:onBlurUpper(this);" })</td>
                            <td>@Html.TextBoxFor(model => model.vPriApellido, new { style = "width:120px;", maxlength = 120, onblur = "javascript:onBlurUpper(this);" })</td>
                            <td>@Html.TextBoxFor(model => model.vSegApellido, new { style = "width:120px;", maxlength = 120, onblur = "javascript:onBlurUpper(this);" })</td>
                            <td>@Html.DropDownListFor(model => model.SIPDetEstadoCivil1.nIdeEstadoCivil, (IEnumerable<SelectListItem>)ViewBag.EstadoCivil, "--Seleccione--", new { @class = "select8" })</td>
                        </tr>
                        <tr>
                            <td>País nacimiento<span class="asterisco">(*)</span></td>
                            <td>Región nacimiento</td>
                            <td colspan="3" rowspan="2">
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr class="tituloCelesteN8">
                                        <td>Provincia</td>
                                        <td>Distrito</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div id="divProvinciasNac">
                                                <select id="nIdeProvNac" name="nIdeProvNac" style="width:200px;" >
                                                    <option value="">--Seleccione--</option>
                                                </select>
                                            </div>
                                        </td>
                                        <td>
                                            <div id="divDistritosNac">
                                                <select id="nIdeDistritoNac" name="nIdeDistritoNac" style="width:200px;" >
                                                    <option value="">--Seleccione--</option>
                                                </select>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </td>                           
                        </tr>
                        <tr>
                            <td>@Html.DropDownListFor(model => model.nIdePaisNac, (IEnumerable<SelectListItem>)ViewBag.PaisEmisor, "--Seleccione--", new { @class = "select8", style = "width:127px;" })</td>
                            <td>@Html.DropDownListFor(model => model.nIdeRegionNac, (IEnumerable<SelectListItem>)ViewBag.Regiones, "--Seleccione--", new { @class = "select8", style = "width:127px;", onchange = "javascript:cargaUbigeo(this,'1');" })</td>                                                       
                        </tr>                        
                        <tr>
                            <td>
                                <table border="0" cellpadding="0" cellspacing="0">
                                    <tr class="tituloCelesteN8" align="center">
                                        <td>Prefijo1</td>
                                        <td>&nbsp;</td>
                                        <td>Teléfono1</td>
                                    </tr>
                                    <tr class="tituloCelesteN8">
                                        <td>@Html.TextBoxFor(model => model.SIPDetTelefono1.vPrefijo, new { style = "width:40px;", maxlength = 6, onblur = "javascript:onBlurUpper(this);" })</td>
                                        <td>-</td>
                                        <td>@Html.TextBoxFor(model => model.SIPDetTelefono1.vNumTel, new { style = "width:80px;", maxlength = 20 , onblur = "javascript:onBlurUpper(this);"})</td>
                                    </tr>
                                </table>
                            </td>
                            <td>
                                <table border="0" cellpadding="0" cellspacing="0">
                                    <tr class="tituloCelesteN8" align="center">
                                        <td>Prefijo2</td>
                                        <td>&nbsp;</td>
                                        <td>Teléfono2</td>
                                    </tr>
                                    <tr class="tituloCelesteN8">
                                        <td>@Html.TextBoxFor(model => model.SIPDetTelefono2.vPrefijo, new { style = "width:40px;", maxlength = 6, onblur = "javascript:onBlurUpper(this);" })</td>
                                        <td>-</td>
                                        <td>@Html.TextBoxFor(model => model.SIPDetTelefono2.vNumTel, new { style = "width:80px;", maxlength = 20, onblur = "javascript:onBlurUpper(this);" })</td>
                                    </tr>
                                </table>
                            </td>
                            <td colspan="2">
                                <table>
                                    <tr class="tituloCelesteN8">
                                        <td>Correo electrónico</td>
                                    </tr>
                                    <tr class="tituloCelesteN8">
                                        <td>@Html.TextBoxFor(model => model.SIPDetCorreo1.vCorreo, new { style = "width:275px;text-transform:none;", maxlength = 145 })</td>                                       
                                    </tr>
                                </table>
                            </td>
                            <td>
                                <table>
                                    <tr class="tituloCelesteN8">
                                        <td>Fecha Fallecimiento</td>
                                    </tr>
                                    <tr class="tituloCelesteN8">
                                        <td>@Html.TextBoxFor(model => model.dFecFalle, new { maxlength = 10, readOnly = true })</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
    </table>
    <br />
    <table>
        <tr>
            <td style="width:50%"><b>Campo Obligatorio:</b>&nbsp;<span class="asterisco">(*)</span></td>
            <td style="width:20%"><input type="button" value="Registrar Datos" onclick="javascript: addPersonaNaturalPopFinal(this,this.form);" /></td>
            <td style="width:10%"><a onclick="javascript: consultaEsSalud(this.form);">EsSalud</a></td>
            <td style="width:10%"><a onclick="javascript: consultaSis(this.form);">S.I.S</a></td>
            <td style="width:10%"><a onclick="javascript: consultaSisfoh(this.form);">SISFOH</a></td>
        </tr>
    </table> 
    @Html.Hidden("nIdeTipoPer", Constante.getInstance().N_IDE_DETALLE_TIPO_PERSONA_INTERNA)
    @Html.Hidden("nIdeUsuReg", @Session[Constante.N_IDE_USUARIO])
    @Html.Hidden("dtFecReg", @DateTime.Now.ToString())
    @Html.Hidden("dFecIniVig", @DateTime.Now.ToString())

    @Html.Hidden("SIPDetEstadoCivil1.dFecIniVig", @DateTime.Now.ToString())
    @Html.Hidden("SIPDetEstadoCivil1.nIdeUsuReg", @Session[Constante.N_IDE_USUARIO])
    @Html.Hidden("SIPDetEstadoCivil1.dtFecReg", @DateTime.Now.ToString())    
    
    @Html.Hidden("SIPDetDireccion1.nIdeUsuReg", @Session[Constante.N_IDE_USUARIO])
    @Html.Hidden("SIPDetDireccion1.dtFecReg", @DateTime.Now.ToString())
    @Html.Hidden("SIPDetDireccion1.dFecIniVig", @DateTime.Now.ToString())
    
    @Html.Hidden("SIPDetTelefono1.nIdeUsuReg", @Session[Constante.N_IDE_USUARIO])
    @Html.Hidden("SIPDetTelefono1.dFecIniVig", @DateTime.Now.ToString())
    @Html.Hidden("SIPDetTelefono1.dtFecReg", @DateTime.Now.ToString())

    @Html.Hidden("SIPDetTelefono2.nIdeUsuReg", @Session[Constante.N_IDE_USUARIO])
    @Html.Hidden("SIPDetTelefono2.dFecIniVig", @DateTime.Now.ToString())
    @Html.Hidden("SIPDetTelefono2.dtFecReg", @DateTime.Now.ToString())

    @Html.Hidden("SIPDetCorreo1.nIdeUsuReg", @Session[Constante.N_IDE_USUARIO])
    @Html.Hidden("SIPDetCorreo1.dFecIniVig", @DateTime.Now.ToString())
    @Html.Hidden("SIPDetCorreo1.dFecReg", @DateTime.Now.ToString()) 
</fieldset>   
}
}else{    
 <div>@RenderPage("../../Shared/RODatosPersona.cshtml")</div>
}